home *** CD-ROM | disk | FTP | other *** search
/ 3D Games - Real-time Rend…ng & Software Technology / 3D Games - Real-time Rendering & Software Technology.iso / flysdk / util / max / expflybsp / scene_max.h < prev   
Encoding:
C/C++ Source or Header  |  2000-06-15  |  1.4 KB  |  75 lines

  1. class light_max
  2. {
  3. public:
  4.     char name[256];
  5.     int type;
  6.     vector color,pos,target,dir;
  7.     float hotspot,falloff;
  8. };
  9.  
  10. class bsp_node_max : public bsp_node
  11. {    
  12. public:
  13.     int nplanes,side;
  14.     plane *planes;
  15.     char *planeflags;
  16.     boundbox bbox;
  17.  
  18.     bsp_node_max() 
  19.     { planes=0; nplanes=0; planeflags=0; };
  20.     ~bsp_node_max() 
  21.     { if (planes) delete planes; };
  22.  
  23.     void split_faces_aligned();
  24.     void split_axis_aligned(int depth);
  25.     void add_face(face *f,int planeflag);
  26.     void free_faces();
  27.     void print(FILE *fp,int& tot,int depth);
  28.  
  29.     int find_split_plane();
  30.     int find_plane(vector& normal,float d0);
  31.     int add_plane(vector& normal,float d0);
  32.     void calc_bbox();
  33. };
  34.  
  35. class scene_max : public flyEngine
  36. {
  37. public:
  38.     void compute_scene_normals();
  39.     int nmatlib;
  40.     material *matlib;
  41.  
  42.     int nlights;
  43.     light_max *lightlib;
  44.  
  45.     int nleaf;
  46.  
  47.     void build_bsptree();
  48.     void enum_leaf(bsp_node *n);
  49.     void compute_light();
  50.     void save_map(char *);
  51.     void save(char *);
  52.  
  53.     scene_max() 
  54.         { 
  55.         lightlib=0; 
  56.         nlights=0;
  57.         matlib=new material;
  58.         strcpy(matlib[0].name, "");
  59.         matlib[0].ambient[0]=0;
  60.         matlib[0].ambient[1]=0;
  61.         matlib[0].ambient[2]=0;
  62.         matlib[0].diffuse[0]=.5f;
  63.         matlib[0].diffuse[1]=.5f;
  64.         matlib[0].diffuse[2]=.5f;
  65.         matlib[0].transparency=0;
  66.         matlib[0].self_illum=0;
  67.         nmatlib=1;
  68.         };
  69.     ~scene_max() 
  70.         {
  71.         if (matlib) delete matlib; 
  72.         if (lightlib) delete lightlib; 
  73.         };
  74. };
  75.